Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non blocking download #34

Merged
merged 9 commits into from
May 27, 2024
Merged

Non blocking download #34

merged 9 commits into from
May 27, 2024

Conversation

andreagilardoni
Copy link
Contributor

This PR aims to provide ESP32 OTA with a download that runs in a non blocking fashion, for this reason the code of the download routine is implemented similarly to IOTCloud new implementation released in https://github.com/arduino-libraries/ArduinoIoTCloud/tree/2.0.0

@andreagilardoni andreagilardoni force-pushed the non-blocking-download branch from 23c6493 to 2dbf0fb Compare May 22, 2024 11:16
@andreagilardoni andreagilardoni requested a review from pennam May 22, 2024 11:21
Copy link

Memory usage change @ d329606

Board flash % RAM for global variables %
arduino:esp32:nano_nora 💚 -227960 - 0 -7.25 - 0.0 💚 -10040 - 0 -3.06 - 0.0
esp32:esp32:esp32 💚 -227748 - 0 -17.38 - 0.0 💚 -11200 - 0 -3.42 - 0.0
Click for full report table
Board examples/OTA_Arduino_Server
flash
% examples/OTA_Arduino_Server
RAM for global variables
% examples/OTA_GitHub_Server
flash
% examples/OTA_GitHub_Server
RAM for global variables
% examples/NANO_ESP32_Blink
flash
% examples/NANO_ESP32_Blink
RAM for global variables
% examples/LOLIN_32_Blink
flash
% examples/LOLIN_32_Blink
RAM for global variables
%
arduino:esp32:nano_nora -225304 -7.16 -10040 -3.06 -227960 -7.25 -10040 -3.06 0 0.0 0 0.0
esp32:esp32:esp32 -225076 -17.17 -11200 -3.42 -227748 -17.38 -11200 -3.42 0 0.0 0 0.0
Click for full report CSV
Board,examples/OTA_Arduino_Server<br>flash,%,examples/OTA_Arduino_Server<br>RAM for global variables,%,examples/OTA_GitHub_Server<br>flash,%,examples/OTA_GitHub_Server<br>RAM for global variables,%,examples/NANO_ESP32_Blink<br>flash,%,examples/NANO_ESP32_Blink<br>RAM for global variables,%,examples/LOLIN_32_Blink<br>flash,%,examples/LOLIN_32_Blink<br>RAM for global variables,%
arduino:esp32:nano_nora,-225304,-7.16,-10040,-3.06,-227960,-7.25,-10040,-3.06,0,0.0,0,0.0
esp32:esp32:esp32,-225076,-17.17,-11200,-3.42,-227748,-17.38,-11200,-3.42,,,,,0,0.0,0,0.0

@andreagilardoni andreagilardoni marked this pull request as draft May 22, 2024 11:50
Copy link
Collaborator

@pennam pennam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would take this chance to move LZSS decoder in a separate library, probably also CRC32 stuff; that code can be reused here and from ArduinoIoTCloud.

Apart from that LGTM

I did not test it 🙂

@andreagilardoni andreagilardoni force-pushed the non-blocking-download branch from d329606 to d153911 Compare May 22, 2024 12:00
Copy link

Memory usage change @ d153911

Board flash % RAM for global variables %
arduino:esp32:nano_nora 💚 -227780 - 0 -7.24 - 0.0 💚 -10040 - 0 -3.06 - 0.0
esp32:esp32:esp32 💚 -227568 - 0 -17.36 - 0.0 💚 -11200 - 0 -3.42 - 0.0
Click for full report table
Board examples/OTA_Arduino_Server
flash
% examples/OTA_Arduino_Server
RAM for global variables
% examples/OTA_GitHub_Server
flash
% examples/OTA_GitHub_Server
RAM for global variables
% examples/NANO_ESP32_Blink
flash
% examples/NANO_ESP32_Blink
RAM for global variables
% examples/LOLIN_32_Blink
flash
% examples/LOLIN_32_Blink
RAM for global variables
%
arduino:esp32:nano_nora -225124 -7.16 -10040 -3.06 -227780 -7.24 -10040 -3.06 0 0.0 0 0.0
esp32:esp32:esp32 -224896 -17.16 -11200 -3.42 -227568 -17.36 -11200 -3.42 0 0.0 0 0.0
Click for full report CSV
Board,examples/OTA_Arduino_Server<br>flash,%,examples/OTA_Arduino_Server<br>RAM for global variables,%,examples/OTA_GitHub_Server<br>flash,%,examples/OTA_GitHub_Server<br>RAM for global variables,%,examples/NANO_ESP32_Blink<br>flash,%,examples/NANO_ESP32_Blink<br>RAM for global variables,%,examples/LOLIN_32_Blink<br>flash,%,examples/LOLIN_32_Blink<br>RAM for global variables,%
arduino:esp32:nano_nora,-225124,-7.16,-10040,-3.06,-227780,-7.24,-10040,-3.06,0,0.0,0,0.0
esp32:esp32:esp32,-224896,-17.16,-11200,-3.42,-227568,-17.36,-11200,-3.42,,,,,0,0.0,0,0.0

@andreagilardoni andreagilardoni marked this pull request as ready for review May 22, 2024 12:10
@pennam
Copy link
Collaborator

pennam commented May 22, 2024

This PR should also fix #28

@per1234 per1234 linked an issue May 22, 2024 that may be closed by this pull request
@andreagilardoni andreagilardoni marked this pull request as draft May 23, 2024 13:07
Copy link

Memory usage change @ 38bdbc3

Board flash % RAM for global variables %
arduino:esp32:nano_nora 💚 -227760 - 0 -7.24 - 0.0 💚 -10040 - 0 -3.06 - 0.0
esp32:esp32:esp32 💚 -227548 - 0 -17.36 - 0.0 💚 -11200 - 0 -3.42 - 0.0
Click for full report table
Board examples/OTA_Arduino_Server
flash
% examples/OTA_Arduino_Server
RAM for global variables
% examples/OTA_GitHub_Server
flash
% examples/OTA_GitHub_Server
RAM for global variables
% examples/NANO_ESP32_Blink
flash
% examples/NANO_ESP32_Blink
RAM for global variables
% examples/LOLIN_32_Blink
flash
% examples/LOLIN_32_Blink
RAM for global variables
%
arduino:esp32:nano_nora -225104 -7.16 -10040 -3.06 -227760 -7.24 -10040 -3.06 0 0.0 0 0.0
esp32:esp32:esp32 -224876 -17.16 -11200 -3.42 -227548 -17.36 -11200 -3.42 0 0.0 0 0.0
Click for full report CSV
Board,examples/OTA_Arduino_Server<br>flash,%,examples/OTA_Arduino_Server<br>RAM for global variables,%,examples/OTA_GitHub_Server<br>flash,%,examples/OTA_GitHub_Server<br>RAM for global variables,%,examples/NANO_ESP32_Blink<br>flash,%,examples/NANO_ESP32_Blink<br>RAM for global variables,%,examples/LOLIN_32_Blink<br>flash,%,examples/LOLIN_32_Blink<br>RAM for global variables,%
arduino:esp32:nano_nora,-225104,-7.16,-10040,-3.06,-227760,-7.24,-10040,-3.06,0,0.0,0,0.0
esp32:esp32:esp32,-224876,-17.16,-11200,-3.42,-227548,-17.36,-11200,-3.42,,,,,0,0.0,0,0.0

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels May 23, 2024
Copy link

Memory usage change @ 046e03f

Board flash % RAM for global variables %
arduino:esp32:nano_nora 💚 -227868 - 0 -7.24 - 0.0 💚 -10040 - 0 -3.06 - 0.0
esp32:esp32:esp32 💚 -227656 - 0 -17.37 - 0.0 💚 -11200 - 0 -3.42 - 0.0
Click for full report table
Board examples/OTA_Arduino_Server
flash
% examples/OTA_Arduino_Server
RAM for global variables
% examples/OTA_GitHub_Server
flash
% examples/OTA_GitHub_Server
RAM for global variables
% examples/NANO_ESP32_Blink
flash
% examples/NANO_ESP32_Blink
RAM for global variables
% examples/LOLIN_32_Blink
flash
% examples/LOLIN_32_Blink
RAM for global variables
%
arduino:esp32:nano_nora -225212 -7.16 -10040 -3.06 -227868 -7.24 -10040 -3.06 0 0.0 0 0.0
esp32:esp32:esp32 -224984 -17.16 -11200 -3.42 -227656 -17.37 -11200 -3.42 0 0.0 0 0.0
Click for full report CSV
Board,examples/OTA_Arduino_Server<br>flash,%,examples/OTA_Arduino_Server<br>RAM for global variables,%,examples/OTA_GitHub_Server<br>flash,%,examples/OTA_GitHub_Server<br>RAM for global variables,%,examples/NANO_ESP32_Blink<br>flash,%,examples/NANO_ESP32_Blink<br>RAM for global variables,%,examples/LOLIN_32_Blink<br>flash,%,examples/LOLIN_32_Blink<br>RAM for global variables,%
arduino:esp32:nano_nora,-225212,-7.16,-10040,-3.06,-227868,-7.24,-10040,-3.06,0,0.0,0,0.0
esp32:esp32:esp32,-224984,-17.16,-11200,-3.42,-227656,-17.37,-11200,-3.42,,,,,0,0.0,0,0.0

@andreagilardoni andreagilardoni force-pushed the non-blocking-download branch from 046e03f to 32ff784 Compare May 24, 2024 11:41
Copy link

Memory usage change @ 32ff784

Board flash % RAM for global variables %
arduino:esp32:nano_nora 💚 -227864 - 0 -7.24 - 0.0 💚 -10040 - 0 -3.06 - 0.0
esp32:esp32:esp32 💚 -227652 - 0 -17.37 - 0.0 💚 -11200 - 0 -3.42 - 0.0
Click for full report table
Board examples/OTA_Arduino_Server
flash
% examples/OTA_Arduino_Server
RAM for global variables
% examples/OTA_GitHub_Server
flash
% examples/OTA_GitHub_Server
RAM for global variables
% examples/NANO_ESP32_Blink
flash
% examples/NANO_ESP32_Blink
RAM for global variables
% examples/LOLIN_32_Blink
flash
% examples/LOLIN_32_Blink
RAM for global variables
%
arduino:esp32:nano_nora -225208 -7.16 -10040 -3.06 -227864 -7.24 -10040 -3.06 0 0.0 0 0.0
esp32:esp32:esp32 -224980 -17.16 -11200 -3.42 -227652 -17.37 -11200 -3.42 0 0.0 0 0.0
Click for full report CSV
Board,examples/OTA_Arduino_Server<br>flash,%,examples/OTA_Arduino_Server<br>RAM for global variables,%,examples/OTA_GitHub_Server<br>flash,%,examples/OTA_GitHub_Server<br>RAM for global variables,%,examples/NANO_ESP32_Blink<br>flash,%,examples/NANO_ESP32_Blink<br>RAM for global variables,%,examples/LOLIN_32_Blink<br>flash,%,examples/LOLIN_32_Blink<br>RAM for global variables,%
arduino:esp32:nano_nora,-225208,-7.16,-10040,-3.06,-227864,-7.24,-10040,-3.06,0,0.0,0,0.0
esp32:esp32:esp32,-224980,-17.16,-11200,-3.42,-227652,-17.37,-11200,-3.42,,,,,0,0.0,0,0.0

@andreagilardoni andreagilardoni marked this pull request as ready for review May 24, 2024 11:48
@andreagilardoni andreagilardoni force-pushed the non-blocking-download branch from 32ff784 to 93c64ee Compare May 27, 2024 08:06
Copy link

Memory usage change @ 93c64ee

Board flash % RAM for global variables %
arduino:esp32:nano_nora 💚 -227864 - 0 -7.24 - 0.0 💚 -10040 - 0 -3.06 - 0.0
esp32:esp32:esp32 💚 -227652 - 0 -17.37 - 0.0 💚 -11200 - 0 -3.42 - 0.0
Click for full report table
Board examples/OTA_Arduino_Server
flash
% examples/OTA_Arduino_Server
RAM for global variables
% examples/OTA_GitHub_Server
flash
% examples/OTA_GitHub_Server
RAM for global variables
% examples/NANO_ESP32_Blink
flash
% examples/NANO_ESP32_Blink
RAM for global variables
% examples/LOLIN_32_Blink
flash
% examples/LOLIN_32_Blink
RAM for global variables
%
arduino:esp32:nano_nora -225208 -7.16 -10040 -3.06 -227864 -7.24 -10040 -3.06 0 0.0 0 0.0
esp32:esp32:esp32 -224980 -17.16 -11200 -3.42 -227652 -17.37 -11200 -3.42 0 0.0 0 0.0
Click for full report CSV
Board,examples/OTA_Arduino_Server<br>flash,%,examples/OTA_Arduino_Server<br>RAM for global variables,%,examples/OTA_GitHub_Server<br>flash,%,examples/OTA_GitHub_Server<br>RAM for global variables,%,examples/NANO_ESP32_Blink<br>flash,%,examples/NANO_ESP32_Blink<br>RAM for global variables,%,examples/LOLIN_32_Blink<br>flash,%,examples/LOLIN_32_Blink<br>RAM for global variables,%
arduino:esp32:nano_nora,-225208,-7.16,-10040,-3.06,-227864,-7.24,-10040,-3.06,0,0.0,0,0.0
esp32:esp32:esp32,-224980,-17.16,-11200,-3.42,-227652,-17.37,-11200,-3.42,,,,,0,0.0,0,0.0

@andreagilardoni andreagilardoni force-pushed the non-blocking-download branch from 93c64ee to 47a716f Compare May 27, 2024 08:13
Copy link

Memory usage change @ 47a716f

Board flash % RAM for global variables %
arduino:esp32:nano_nora 💚 -227864 - 0 -7.24 - 0.0 💚 -10040 - 0 -3.06 - 0.0
esp32:esp32:esp32 💚 -227652 - 0 -17.37 - 0.0 💚 -11200 - 0 -3.42 - 0.0
Click for full report table
Board examples/OTA_Arduino_Server
flash
% examples/OTA_Arduino_Server
RAM for global variables
% examples/OTA_GitHub_Server
flash
% examples/OTA_GitHub_Server
RAM for global variables
% examples/NANO_ESP32_Blink
flash
% examples/NANO_ESP32_Blink
RAM for global variables
% examples/LOLIN_32_Blink
flash
% examples/LOLIN_32_Blink
RAM for global variables
%
arduino:esp32:nano_nora -225208 -7.16 -10040 -3.06 -227864 -7.24 -10040 -3.06 0 0.0 0 0.0
esp32:esp32:esp32 -224980 -17.16 -11200 -3.42 -227652 -17.37 -11200 -3.42 0 0.0 0 0.0
Click for full report CSV
Board,examples/OTA_Arduino_Server<br>flash,%,examples/OTA_Arduino_Server<br>RAM for global variables,%,examples/OTA_GitHub_Server<br>flash,%,examples/OTA_GitHub_Server<br>RAM for global variables,%,examples/NANO_ESP32_Blink<br>flash,%,examples/NANO_ESP32_Blink<br>RAM for global variables,%,examples/LOLIN_32_Blink<br>flash,%,examples/LOLIN_32_Blink<br>RAM for global variables,%
arduino:esp32:nano_nora,-225208,-7.16,-10040,-3.06,-227864,-7.24,-10040,-3.06,0,0.0,0,0.0
esp32:esp32:esp32,-224980,-17.16,-11200,-3.42,-227652,-17.37,-11200,-3.42,,,,,0,0.0,0,0.0

@andreagilardoni andreagilardoni force-pushed the non-blocking-download branch from 47a716f to 13c6009 Compare May 27, 2024 08:21
@andreagilardoni andreagilardoni merged commit 72e71bf into main May 27, 2024
9 checks passed
@pennam pennam deleted the non-blocking-download branch November 26, 2024 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download url parser discards port
3 participants